package com.apollographql.apollo.api.internal.json;

import com.kt.Metadata;

@Metadata(bv = {1, 0, 3}, d1 = {"\u0000\u0016\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\u001a>\u0010\u0000\u001a\u0002H\u0001\"\u0010\b\u0000\u0010\u0002*\n\u0018\u00010\u0003j\u0004\u0018\u0001`\u0004\"\u0004\b\u0001\u0010\u0001*\u0002H\u00022\u0012\u0010\u0005\u001a\u000e\u0012\u0004\u0012\u0002H\u0002\u0012\u0004\u0012\u0002H\u00010\u0006H\b¢\u0006\u0002\u0010\u0007¨\u0006\b"}, d2 = {"use", "R", "T", "Ljava/io/Closeable;", "Lcom/apollographql/apollo/api/internal/json/Closeable;", "block", "Lkotlin/Function1;", "(Ljava/io/Closeable;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;", "apollo-api"}, k = 2, mv = {1, 4, 0})
/* compiled from: use.kt */
public final class UseKt {
    /* JADX WARNING: Code restructure failed: missing block: B:12:0x0023, code lost:
        r3 = move-exception;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:13:0x0024, code lost:
        com.kt.jvm.internal.InlineMarker.finallyStart(1);
     */
    /* JADX WARNING: Code restructure failed: missing block: B:14:0x0028, code lost:
        if (r5 != null) goto L_0x002c;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:16:?, code lost:
        r5.close();
     */
    /* JADX WARNING: Code restructure failed: missing block: B:18:0x0031, code lost:
        com.kt.jvm.internal.InlineMarker.finallyEnd(1);
     */
    /* JADX WARNING: Code restructure failed: missing block: B:19:0x0035, code lost:
        throw r3;
     */
    /* Code decompiled incorrectly, please refer to instructions dump. */
    public static final <T extends java.io.Closeable, R> R use(T r5, com.kt.jvm.functions.Function1<? super T, ? extends R> r6) {
        /*
            r0 = 0
            java.lang.String r1 = "block"
            com.kt.jvm.internal.Intrinsics.checkParameterIsNotNull(r6, r1)
            r1 = 0
            java.lang.Throwable r1 = (java.lang.Throwable) r1
            r2 = 1
            java.lang.Object r3 = r6.invoke(r5)     // Catch:{ all -> 0x001e }
            com.kt.jvm.internal.InlineMarker.finallyStart(r2)
            if (r5 != 0) goto L_0x0016
            goto L_0x0019
        L_0x0016:
            r5.close()
        L_0x0019:
            com.kt.jvm.internal.InlineMarker.finallyEnd(r2)
            return r3
        L_0x001e:
            r3 = move-exception
            r1 = r3
            throw r3     // Catch:{ all -> 0x0023 }
        L_0x0023:
            r3 = move-exception
            com.kt.jvm.internal.InlineMarker.finallyStart(r2)
            if (r5 == 0) goto L_0x0031
            r5.close()     // Catch:{ all -> 0x0030 }
            goto L_0x0031
        L_0x0030:
            r4 = move-exception
        L_0x0031:
            com.kt.jvm.internal.InlineMarker.finallyEnd(r2)
            throw r3
        */
        throw new UnsupportedOperationException("Method not decompiled: com.apollographql.apollo.api.internal.json.UseKt.use(java.io.Closeable, com.kt.jvm.functions.Function1):java.lang.Object");
    }
}
